package com.gxy.learn.service.impl;

import com.gxy.learn.dao.UserMapper;
import com.gxy.learn.entity.User;
import com.gxy.learn.service.ProviderService;
import io.seata.core.context.RootContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Random;

@Slf4j
@Service
public class ProviderServiceImpl implements ProviderService {
    @Resource
    UserMapper userMapper;

    @Override
    public void insertTesdt() {
        log.info("xid = {}", RootContext.getXID());
        userMapper.insert(new User(Long.valueOf(new Random().nextInt(100)), "user", 18, "122@126.com"));
    }
}
